<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<link href="${basePath}/static/css/Pigeonhole/Pigeonhole_list.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="${basePath}/static/css/medicalRecord_Search/medicalSearch.css"/>
<script type="text/javascript" src="${basePath}/static/publics/assets/jqPaginator/jqPaginator.js"></script>
<script type="text/javascript" src="${basePath}/static/publics/assets/My97DatePicker/WdatePicker.js"></script>
<script type="text/javascript">
	function collectionReportToExcel(){
		var basePath = $("#basePath").val();
		$("#queryForm").attr("action",basePath+"/statistics/collectionReportToExcel")
		$("#queryForm").submit();
	}
	
	function queryFormSubmit(){
		var basePath = $("#basePath").val();
		$("#queryForm").attr("action",basePath+"/statistics/collectionStatistics")
		$("#queryForm").submit();
	}
</script>
<div class="list_NR">
        <div class="loc">
            <h3>归档病案迟送统计</h3>
           <!--  <ul class="loc_loc">病案归档 > 归档数据统计 -->
            </ul>
        </div>
        
        <div class="list_con_table">
			 <form action="${basePath}/statistics/collectionStatistics" method="get" id="queryForm">
	        	<div class="search_table" style="height:auto;">
                <ul class="clearfix" style="margin-bottom:0;">
                    
                    <li class="Label_1" style="width:11%">归档日期：&nbsp;</li>
                    <li class="Label_2" style="width:27%;">
                    <input class="input_box" style="width:43%;" type="text"  name="traceStartDate" value='<fmt:formatDate value="${medTraceQuery.traceStartDate}" pattern="yyyy-MM-dd"/>' onFocus="WdatePicker()"/> - 
                    <input class="input_box" style="width:43%" type="text"  name="traceEndDate"  value='<fmt:formatDate value="${medTraceQuery.traceEndDate}" pattern="yyyy-MM-dd"/>' onFocus="WdatePicker()"/>
                    </li>
                   <li class="Label_1" style="width:11%">ID号：&nbsp;</li>
                    <li class="Label_2"><input class="input_box" type="text"  name="mrId" value='${medTraceQuery.mrId}' /></li>
                     
     				<li class="Label_1" style="width:11%">迟送天数&nbsp;&gt;</li>
                    <li class="Label_2"><input class="input_box" type="text"  name="beyondDay" value='${beyondDay}' /></li>
                    
                    <li class="Label_1" style="width:11%">出院日期：&nbsp;</li>
                    <li class="Label_2" style="width:27%;">
                    <input class="input_box" style="width:43%;" type="text"  name="outHospitalStartDate" value='<fmt:formatDate value="${medTraceQuery.outHospitalStartDate}" pattern="yyyy-MM-dd"/>' onFocus="WdatePicker()"/> - 
                    <input class="input_box" style="width:43%" type="text"  name="outHospitalEndDate"  value='<fmt:formatDate value="${medTraceQuery.outHospitalEndDate}" pattern="yyyy-MM-dd"/>' onFocus="WdatePicker()"/>
                    </li>
                    
                     <li class="Label_1" style="width:11%">出院科室：&nbsp;</li>
                    <li class="Label_2" style="width:50%;text-align:left;padding-left:5px">
                    
                    	<select class="input_box" style="width:38%" name="outHospitalOfficeId">
                    		<option value="">请选择</option>
                    		<c:forEach var="office" items="${offices }"> 
                    			<option <c:if test="${medTraceQuery.outHospitalOfficeId==office.id}">selected="selected"</c:if> value="${office.id }">${office.name }</option>
                    		</c:forEach>
                    	
                    	</select>
                    </li>
                    <li class="Label_5">
                        <div class="right">
                        	<a id="queryA" onclick="queryFormSubmit()">查询</a>
                        </div>
                    </li>
                </ul>
            </div>
	        </form>
        </div>
        <c:if test="${not empty collectionStatistics['collectResult'] }">
        	<h5 align="center">总记录数:${collectionStatistics['collectResult'].collectTotal },<input type="button" name="" class="int" onclick="collectionReportToExcel()" value="导出">&nbsp;${beyondDay}日归档率${collectionStatistics['collectResult'].collectRate}%</h5>
        </c:if>
       	
        <table class="Search_tableList">
     
            <tr>
                <td class="tdLabel_4">姓名</td>
                <td class="tdLabel_4">ID号</td>
                <td class="tdLabel_4">住院次数</td>
                <td class="tdLabel_4">出院科室</td>
                <td class="tdLabel_4">出院日期</td>
                <td class="tdLabel_4">归档日期</td>
                <td class="tdLabel_4">迟送天数</td>
            </tr>
            
           
            <tbody id="tbody">
            	<c:if test="${not empty collectionStatistics['detail'] }">
            		<c:forEach var="collectionOfMedRecord" items="${collectionStatistics['detail'] }">
            		<tr>
            			
            			<td class='tdLabel_5'>${collectionOfMedRecord.patient_name}</td>
            			<td class='tdLabel_5'>${collectionOfMedRecord.mr_id}</td>
            			<td class='tdLabel_5'>${collectionOfMedRecord.visit_number}</td>
            			<td class='tdLabel_5'>${collectionOfMedRecord.office_name }</td> 
            			<td class='tdLabel_5'><fmt:formatDate value="${collectionOfMedRecord.out_hospital_date}" pattern="yyyy-MM-dd"/></td>
            			<td class='tdLabel_5'><fmt:formatDate value="${collectionOfMedRecord.trace_date}" pattern="yyyy-MM-dd"/></td>
            			
            			<td class='tdLabel_5'>${collectionOfMedRecord.date_diff}</td>
            			
            		</tr>
            	</c:forEach>
            	</c:if>
            	
            </tbody>
               
           
        </table>


       
    </div>
